//用户添加表单的异步提交
$(function(){
    $('#addForm').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
	            <#list columnList as column>
				   ${column}: {
	                    message: '输入错误',
	                    validators: {
	                    notEmpty: {
	                            message: '不能为空'
	                        }
	                    }
	                },
				</#list>
          }
        }).on('success.form.bv', function(e) {
            e.preventDefault();
            var $form = $(e.target);
            var bv = $form.data('bootstrapValidator');
            $.post($form.attr('action'), $form.serialize(), function(result) {
            	if (result.retcode==1) {
    				successTip(result.retmsg);
    			}else{
    				failureTip(result.retmsg);
    			}
            	location.href=Globals.ctx+"${camelModelName}/${camelModelName}Info";
            }, 'json');
        });
});